﻿<?xml version="1.0" encoding="utf-8"?>
<DataDictionary.System>
  <Entities>
    <Entity name="tblUsuario">
      <Description>Tabela onde ficarão as informações sobre os usuários e os grupos de usuários.</Description>
      <FriendlyName>Usuários</FriendlyName>
      <Columns>
        <Column name="UsuarioGrupoID">
          <Description>Código do usuário.</Description>
          <FriendlyName>Código</FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>true</AutoGenerated>
          <Size>
          </Size>
          <DefaultValue>
          </DefaultValue>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Nome">
          <Description>Nome do usuário.</Description>
          <FriendlyName>Nome</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>true</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>50</Size>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Descricao">
          <Description>Descrição do usuário.</Description>
          <FriendlyName>Descrição</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>255</Size>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Email">
          <Description>E-mail do usuário.</Description>
          <FriendlyName>E-mail</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>255</Size>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Usuario">
          <Description>Se é usuario ou nao (grupo).</Description>
          <FriendlyName>Usuário</FriendlyName>
          <DataType>Bit</DataType>
          <Required>true</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="Senha">
          <Description>Senha do usuário.</Description>
          <FriendlyName>Senha</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>20</Size>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="Inativo">
          <Description>Define se o usuário está ativo/inativo.</Description>
          <FriendlyName>Inativo</FriendlyName>
          <DataType>Bit</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="AlterarSenha">
          <Description>Define se usário deve alterar senha no próximo login.</Description>
          <FriendlyName>Alterar senha</FriendlyName>
          <DataType>Bit</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
      </Columns>
      <Modules>
        <Module name="ModuloTeste"></Module>
      </Modules>
    </Entity>
    <Entity name="tblRecurso">
      <Description>Recursos do sistema a quem o usuário poderá ter direito ou nao.</Description>
      <FriendlyName>Recursos</FriendlyName>
      <Columns>
        <Column name="RecursoID">
          <Description>Código do recurso.</Description>
          <FriendlyName>Código</FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>
          </Size>
          <DefaultValue>
          </DefaultValue>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Nome">
          <Description>Nome do recurso.</Description>
          <FriendlyName>Nome</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>true</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Descricao">
          <FriendlyName>Descrição</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>255</Size>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="RecursoPaiID">
          <Description>Código do recurso pai.</Description>
          <DataType>Integer</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="Nivel">
          <Description>Nível que o recurso se encontra.</Description>
          <DataType>Integer</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="ModuloID">
          <Description>Código do módulo que este recurso faz parte.</Description>
          <DataType>Integer</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
      </Columns>
    </Entity>
    <Entity name="tblLog">
      <Description>Ações dos usuários.</Description>
      <FriendlyName>Log</FriendlyName>
      <Columns>
        <Column name="LogID">
          <Description>Código do log.</Description>
          <FriendlyName>Código</FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>true</AutoGenerated>
          <Size>
          </Size>
          <DefaultValue>
          </DefaultValue>
          <ShowDataEntry>true</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="AcaoID">
          <Description>Código da ação.</Description>
          <FriendlyName>Código da ação</FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="UsuarioGrupoID">
          <Description>Código do usuário.</Description>
          <FriendlyName>Usuário</FriendlyName>
          <DataType>Integer</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="Data">
          <Description>Data e hora do evento.</Description>
          <FriendlyName>Data/hora</FriendlyName>
          <DataType>Date</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Host">
          <Description>Endereço do cliente.</Description>
          <FriendlyName>Endereço do usuário</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>50</Size>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Objeto">
          <Description>Objeto que foi alterado.</Description>
          <FriendlyName>Objeto</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>100</Size>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="Descricao">
          <Description>Descrição da ação.</Description>
          <FriendlyName>Descrição</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>255</Size>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
      </Columns>
    </Entity>
    <Entity name="tblPermissao">
      <Description>Permissões dos usuários.</Description>
      <FriendlyName>Permissões</FriendlyName>
      <Columns>
        <Column name="PermissaoID">
          <Description>
          </Description>
          <FriendlyName>
          </FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>true</AutoGenerated>
          <Size>
          </Size>
          <DefaultValue>
          </DefaultValue>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="RecursoID">
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="UsuarioGrupoID">
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
      </Columns>
    </Entity>
    <Entity name="tblGrupoUsuario">
      <Description>Relacionamento entre usuários e grupos. | Um grupo tem vários usuários. Um grupo tem vários grupos.</Description>
      <FriendlyName>Grupos do usuário</FriendlyName>
      <Columns>
        <Column name="GrupoUsuarioID">
          <Description>
          </Description>
          <FriendlyName>
          </FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>true</AutoGenerated>
          <Size>
          </Size>
          <DefaultValue>
          </DefaultValue>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="GrupoID">
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
        <Column name="UsuarioID">
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>true</ShowLists>
        </Column>
      </Columns>
    </Entity>
    <Entity name="tblModulos">
      <Description>Definição dos módulos do sistema.</Description>
      <FriendlyName>Módulos</FriendlyName>
      <Columns>
        <Column name="ModuloID">
          <Description>Código do Módulo.</Description>
          <FriendlyName>Código</FriendlyName>
          <DataType>Integer</DataType>
          <Required>true</Required>
          <PrimaryKey>true</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size></Size>
          <DefaultValue></DefaultValue>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="Titulo">
          <Description>Título do módulo.</Description>
          <FriendlyName>Título</FriendlyName>
          <DataType>Varchar</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size>100</Size>
          <DefaultValue></DefaultValue>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
        <Column name="Instalado">
          <Description>Define se o módulo está instalado para exibir opções nos menus do sistema.</Description>
          <FriendlyName>Instalado</FriendlyName>
          <DataType>Bit</DataType>
          <Required>false</Required>
          <PrimaryKey>false</PrimaryKey>
          <AutoGenerated>false</AutoGenerated>
          <Size></Size>
          <DefaultValue></DefaultValue>
          <ShowDataEntry>false</ShowDataEntry>
          <ShowLists>false</ShowLists>
        </Column>
      </Columns>
    </Entity>
  </Entities>
  <References>
    <Reference name="tblPermissao_to_tblUsuario">
      <Description>Relacionamento dos usuários para as permissões.</Description>
      <ParentName>tblUsuario</ParentName>
      <ParentField>UsuarioGrupoID</ParentField>
      <ChildName>tblPermissao</ChildName>
      <ChildField>UsuarioGrupoID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
    <Reference name="tblPermissao_to_tblRecurso">
      <Description>Relacionamento das permissões com os recursos.</Description>
      <ParentName>tblRecurso</ParentName>
      <ParentField>RecursoID</ParentField>
      <ChildName>tblPermissao</ChildName>
      <ChildField>RecursoID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
    <Reference name="tblRecurso_to_tblRecurso">
      <Description>Relacionamento do recurso filho com o pai.</Description>
      <ParentName>tblRecurso</ParentName>
      <ParentField>RecursoID</ParentField>
      <ChildName>tblRecurso</ChildName>
      <ChildField>RecursoPaiID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
    <Reference name="tblLog_to_tblUsuario">
      <Description>Relacionamento do log com os usuários.</Description>
      <ParentName>tblUsuario</ParentName>
      <ParentField>UsuarioGrupoID</ParentField>
      <ChildName>tblLog</ChildName>
      <ChildField>UsuarioGrupoID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
    <Reference name="tblGrupoUsuario_to_tblUsuario">
      <Description>
      </Description>
      <ParentName>tblUsuario</ParentName>
      <ParentField>UsuarioGrupoID</ParentField>
      <ChildName>tblGrupoUsuario</ChildName>
      <ChildField>GrupoID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
    <Reference name="tblGrupoUsuario_to_tblUsuario2">
      <Description>
      </Description>
      <ParentName>tblUsuario</ParentName>
      <ParentField>UsuarioGrupoID</ParentField>
      <ChildName>tblGrupoUsuario</ChildName>
      <ChildField>UsuarioID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
    <Reference name="tblRecurso_to_tblModulos">
      <Description>Relacionamento dos recursos com os módulos.</Description>
      <ParentName>tblModulos</ParentName>
      <ParentField>ModuloID</ParentField>
      <ChildName>tblRecurso</ChildName>
      <ChildField>ModuloID</ChildField>
      <Cardinality>1:N</Cardinality>
    </Reference>
  </References>
</DataDictionary.System>